/*
 * WozGuiFrameAudioSynch.java
 *
 * Kristina Striegnitz
 */

package de.saar.penguin.give.woz;

import java.awt.*;

public class WozGuiFrameAudioSynch extends javax.swing.JFrame {
    private WozNlgSystem nlgSystem;

    public WozGuiFrameAudioSynch(WozNlgSystem nlgSystem) {
        super();

        this.nlgSystem = nlgSystem;

        initComponents();

        getRootPane().setDefaultButton(beepButton1);
    }

    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        beepButton1 = new javax.swing.JButton();
        beepButton2 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("SGIVE Wizard-of-Oz Interface");

        beepButton1.setText("Beep1");
        beepButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                beepButtonActionPerformed(evt, "Beep 1!");
            }});
        beepButton2.setText("Beep2");
        beepButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                beepButtonActionPerformed(evt, "Beep 2!");
            }});
	
	jPanel1.add(beepButton1);
	jPanel1.add(beepButton2);
	getContentPane().add(jPanel1);
	pack();

    }

    private void beepButtonActionPerformed(java.awt.event.ActionEvent evt, String message) {

        nlgSystem.sendMessage(message);
        Toolkit.getDefaultToolkit().beep();
	nlgSystem.log("WOZ: "+message);
        //messageField.requestFocus();
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new WozGuiFrameNoHistory(null).setVisible(true);
            }
        });
    }

    private javax.swing.JPanel jPanel1;
    private javax.swing.JButton beepButton1;
    private javax.swing.JButton beepButton2;
}
